<%@page import="java.util.HashMap"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="Servlets.*, java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TICKET INFORMATION</title>
</head>
<body>
<%
String[] vals = null;



if(request.getParameter("result") != null)
{
	System.out.println("----Hello---"+request.getParameter("result"));
	vals = ((String)request.getParameter("result")).split("\\$");
}
																
HashMap<String, String> airlineMap = new HashMap<String,String>();
airlineMap.put("UAALS","United AirLines");
airlineMap.put("SWALS","Southwest AirLines");

%>

<table align="center" width="90%" border="2">
<tr ><td></td></tr>
<tr align="center" bordercolor="red"><td>    Travelers List     </td><td></td></tr>
<tr><td></td></tr>
<tr><td align="center"> Airlines : <h3><%= airlineMap.get(vals[vals.length-2]) %></h3> </td><td> Journey Date : <%=vals[vals.length-1]%></td></tr>
</table>


<table align="center" width="90%" border="2">
<tr>
<th>No. of Customers</th>
<th>Customer Id</th>
<th>First Name</th>
<th>Last Name</th>
<th>Ticket No.</th>
<th>Nationality</th>
</tr>
<%for(int i=0,count=1; i<vals.length-2; count++){ %>
<tr>
<td><%=count%> </td>
<td><%=vals[i++]%> </td>
<td><%=vals[i++]%> </td>
<td><%=vals[i++]%> </td>
<td><%=vals[i++]%> </td>
<td><%=vals[i++]%> </td>
</tr>
<%} %>
</table>

</body>
</html>